package com.blackitheima2.polymorphic.test2;
//多态运行
public class TestRun {
    public static void main(String[] args) {
        //多态
        Fu f=new Zi();
        System.out.println(f.a);//成员变量编译和运行都看左(父)
        f.show();//成员方法编译看左(父),运行看右(子)

    }
}
//父类
class Fu{
    int a=10;
    public void show (){
        System.out.println("Fu");
    }
}
//子类
class Zi extends Fu{
    int a=20;
    public void show(){
        System.out.println("Zi");
    }
}
